package com.cti.commons.mqtt.thread;

import com.alibaba.ttl.TransmittableThreadLocal;
import com.cti.commons.mqtt.repository.MqttReceiveMessageLog;

public class MessageContext {

    private static TransmittableThreadLocal<MqttReceiveMessageLog> LOG_THREAD_LOCAL = new TransmittableThreadLocal<>();

    public static MqttReceiveMessageLog getReceiveMessageLog() {
        return LOG_THREAD_LOCAL.get();
    }

    public static void setReceiveMessageLog(MqttReceiveMessageLog receiveMessageLog) {
        LOG_THREAD_LOCAL.set(receiveMessageLog);
    }

    public static void removeReceiveMessageLog() {
        LOG_THREAD_LOCAL.remove();
    }

}
